/*
Xern Entity Relocation Network
Copyright (C) 2011 Ronie Salgado <roniesalg@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "MapData.hpp"

namespace MapXern
{
	// Brush Face
	BrushFace::BrushFace()
	{
		mapScale = Vector2(1.0f, 1.0f);
		textureSize = Vector2(256.0f, 256.0f);
	}

	BrushFace::~BrushFace()
	{
	}

	void BrushFace::AddVertex(const Vector3 &v)
	{
		// Check that the vertex is a part of the face.
		float d = plane.GetDistance(v);
		if(CompareFloat(d, 0.0f) != 0)
			return;

		for(size_t i = 0; i < vertices.size(); i++)
		{
			if(CompareVector3(v, vertices[i]) == 0)
				return;
		}

		vertices.push_back(v);
    }

	// Brush
	Brush::Brush()
	{
	}

	Brush::~Brush()
	{
	}

	// Entity.
	Entity::Entity()
	{
	}

	Entity::~Entity()
	{
	}

	// Object
	Object::Object()
	{
	}

	Object::~Object()
	{
	}
}; // namespace MapXern
